package com.eight.clientcourse.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.common.pojo.TOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: qy8-education1
 * @description:
 * @author: 张亚祥
 * @create: 2023-06-03 14:45
 **/
public interface OrderDao extends BaseMapper<TOrder> {
    @Select(value = "select o.* FROM t_order o JOIN tb_member tm on o.member_id = tm.id " +
            "JOIN edu_course c on o.course_id = c.id " +
            "JOIN edu_video v on c.id = v.course_id where tm.id =#{memberId} and c.id=#{cid}")
    List<TOrder> findOrderByMemberByCourse(@Param("cid") String cid, @Param("memberId") String memberId);
}
